﻿<UserControl x:Class="Road3App.Views.UserControls.EditControls.AddConnectorUC"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:grid="clr-namespace:Road3App.Views.UserControls.EditControls.Crossroad">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        
        <TextBlock Text="{Binding Message}" Grid.Row="0"/>

        <Grid Grid.Row="1" Margin="0,10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            
            <grid:EditGridUC DataContext="{Binding CrossroadVM}" Grid.Column="0" x:Name="grid"/>
            
            <DockPanel Grid.Column="2">
                <DockPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="75"/>
                        <Setter Property="Height" Value="25"/>
                        <Setter Property="Margin" Value="5,0"/>
                    </Style>
                </DockPanel.Resources>
                <TextBlock Text="Cell Sequence" DockPanel.Dock="Top"/>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" DockPanel.Dock="Bottom">
                    <Button Content="Remove" Name="RemoveButton" Click="RemoveButton_Click"/>
                </StackPanel>
                
                <ListBox ItemsSource="{Binding CellSequence}" SelectedItem="{Binding SelectedCell}" 
                         Width="100" Margin="0,10"/>
            </DockPanel>
        </Grid>

        <StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center">
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="VerticalAlignment" Value="Center"/>
                    <Setter Property="Width" Value="80"/>
                    <Setter Property="Margin" Value="10,0"/>
                </Style>
                <Style TargetType="Rectangle">
                    <Setter Property="Stroke" Value="Black"/>
                </Style>
            </StackPanel.Resources>
            <grid:CellUC DataContext="{Binding CellStartState}"/>
            <TextBlock Text="Start"/>
            <grid:CellUC DataContext="{Binding CellFinishState}"/>
            <TextBlock Text="Finish"/>
        </StackPanel>
        
    </Grid>
</UserControl>
